package 江新传;

import java.util.Scanner;

public class L6 {
	public static void main(String[] args) {
		
		Scanner sb = new Scanner (System.in);
		int [] ll ;
		ll = new int[5];
		int c = 0;
		int b =0;
		int d =0;
		
		for (int i = 0; i <=4; i++) {

			System.out.println("请输入员工年龄：");
			ll[i]= sb.nextInt();

		
			
		}
		for (int i = 0; i <=4; i++) {
			
			
		c+=ll[i];
		if (ll[0]>ll[1]&&ll[0]>ll[2]&&ll[0]>ll[3]&&ll[0]>ll[4]) {
			b=ll[0];
		} else if(ll[1]>ll[0]&&ll[1]>ll[2]&&ll[1]>ll[3]&&ll[1]>ll[4]) {
			b=ll[1];
		}else if(ll[2]>ll[1]&&ll[2]>ll[0]&&ll[2]>ll[3]&&ll[2]>ll[4]) {
			b=ll[2];
		}else if(ll[3]>ll[1]&&ll[3]>ll[2]&&ll[3]>ll[0]&&ll[3]>ll[4])
		{
			b=ll[3];
		}else {
			b=ll[4];
		}
		if (ll[0]<ll[1]&&ll[0]<ll[2]&&ll[0]<ll[3]&&ll[0]<ll[4]) {
			d=ll[0];
		} else if(ll[1]<ll[0]&&ll[1]<ll[2]&&ll[1]<ll[3]&&ll[1]<ll[4]) {
			d=ll[1];
		}else if(ll[2]<ll[1]&&ll[2]<ll[0]&&ll[2]<ll[3]&&ll[2]<ll[4]) {
			d=ll[2];
		}else if(ll[3]<ll[1]&&ll[3]<ll[2]&&ll[3]<ll[0]&&ll[3]<ll[4])
		{
			d=ll[3];
		}else {
			d=ll[4];
		
			
			
		}
		}
			System.out.println("平均年龄为："+c/5);
			System.out.println("最大年龄为："+b);
			System.out.println("最小年龄为："+d);
			
		
		
	}
	}
	
